package com.ayq.activiti.model.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.FormContentFilter;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 *
 * <p>静态资源映射</p>
 * @Author ayq
 * @Date 2021/3/30 9:21
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    // 就是这个
    @Bean
    public FormContentFilter formContentFilter () {
        return new FormContentFilter ();
    }

    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 将url为 /static/** 的请求映射到 /static/ 路径下进行查找
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }
}
